@extends('layouts.admin')
@section('content')
    <!--Side menu and right menu -->
    <!-- main content -->
    <section class="content home">
        <div class="container-fluid">
            <div class="block-header">
                <h2>内容管理</h2>
                <ol class="breadcrumb">
                    <li><a href="/admin">首页</a></li>
                    <li><a href="/admin/admin">管理员管理</a></li>
                    <li class="active">管理员列表</li>
                </ol>
            </div>

            @if (Session::has('success'))
                <div class="alert bg-green alert-dismissible" role="alert">
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <p> {{Session::get('success')}}</p>
                </div>
            @endif
            @if(count($errors)>0)
                <div class="alert bg-green alert-warning alert-dismissible" role="alert">
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                    @foreach($errors->all() as $error)
                        <p>{{$error}}</p>
                    @endforeach
                </div>
            @endif
            <div class="row clearfix">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="card">
                        <div class="header">
                            <h2>管理员列表</h2>
                            <ul class="header-dropdown m-r--5">
                                <li class="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="zmdi zmdi-more-vert"></i></a>
                                    <ul class="dropdown-menu pull-right">
                                        <li><a href="{{url('admin/admin/create')}}" class=" waves-effect waves-block">添加管理员</a></li>
                                    </ul>
                                </li>
                            </ul>
                        </div>
                        <div class="body">
                            <div class="table-responsive">
                                <div class="comment-box">

                                    <div class="single-comment-box">
                                        @if ($users!=null)
                                            <table class="table">
                                                <thead>
                                                <tr>
                                                    <th>编号</th>
                                                    <th>管理员名称</th>
                                                    <th>创建时间</th>
                                                    <th>修改时间</th>
                                                    <th>操作</th>
                                                </tr>
                                                </thead>
                                                <tbody>
                                                @foreach ($users as $vo)
                                                    <tr>
                                                        <th>{{$vo->id}}</th>
                                                        <th>{{$vo->name}}</th>
                                                        <th>{{$vo->created_at}}</th>
                                                        <th>{{$vo->updated_at}}</th>
                                                        <td>
                                                            @if($vo->id!=1)
                                                            <div class="from-group" style="float: right;">
                                                                <a href="{{Route('admin.Admin.edit',$vo->id)}}" title="编辑" class="btn btn-default btn-circle waves-effect waves-circle waves-float"> <i class="material-icons">edit</i> </a>
                                                            </div>
                                                                @endif
                                                        </td>
                                                    </tr>
                                                @endforeach
                                                </tbody>
                                            </table>
                                        @else
                                            <p>没有用户</p>
                                        @endif
                                    </div>
                                </div>
                                <nav>
                                    {{ $users->links() }}
                                </nav>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

@endsection

@push('scripts')
<script src="/assets/plugins/jquery-datatable/jquery.dataTables.js"
<script >
    $('.js-basic-example').DataTable();
</script>
@endpush